package awt;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Demo3 extends JFrame {
	JButton jb1, jb2, jb3, jb4, jb5;

	public Demo3() {

		jb1 = new JButton("关羽");
		jb1.setSize(100, 50);
		jb2 = new JButton("张飞");
		jb3 = new JButton("赵云");
		jb4 = new JButton("马超");
		jb5 = new JButton("黄忠");
		this.add(jb1);
		this.add(jb2);
		this.add(jb3);
		this.add(jb4);
		this.add(jb5);
		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		this.setTitle("流式布局");
		this.setSize(200, 300);
		this.setLocation(100, 200);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
		this.setResizable(true);

	}

	public static void main(String[] args) {
		Demo3 demo3 = new Demo3();

	}

}
